package com.sanley.piss.model.po;

import com.sanley.piss.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
 * @author 张凯大天才
 */
@EqualsAndHashCode
@Data
@ApiModel(value = "系统资源",description = "系统资源说明")
public class Menu extends BaseEntity implements Serializable {
    /**
     * 目录的默认父级ID parent_id=0
     */
    public static final Integer DEFAULT_PARENT_VAL=0;

    private static final long serialVersionUID = 3945152650975996881L;

    @ApiModelProperty(value = "资源名称")
    @NotBlank(message = "资源名称不能为空")
    private String title;

    @ApiModelProperty(value = "资源类型0:菜单;1.按钮;2.iframe ")
    @NotNull(message = "资源类型不能为空")
    private int type;

    @ApiModelProperty(value = "URL地址")
    @NotBlank(message = "URL地址不能为空")
    private String url;

    @ApiModelProperty(value = "图标地址")
    private String icon;

    @ApiModelProperty(value = "权限码")
    @NotBlank(message = "权限码不能为空")
    private String perCode;

    @ApiModelProperty(value = "上级权限")
    private Integer parentId;
}